use .env db settings for test environment

Ben Nappier and Parth Gandhi 11 years ago
parent
commit
cb25a087af
1 changed files with 8 additions and 8 deletions
  1. 8 8
      config/database.yml

+ 8 - 8
config/database.yml

@@ -14,14 +14,14 @@ development:
14 14
 # re-generated from your development database when you run "rake".
15 15
 # Do not set this db to the same as development or production.
16 16
 test:
17
-  adapter: mysql2
18
-  database: huginn_test
19
-  username: root
20
-  password:
21
-  socket: <%= ["/var/run/mysqld/mysqld.sock", "/opt/local/var/run/mysql5/mysqld.sock", "/tmp/mysql.sock"].find{ |path| File.exist? path } %>
22
-  encoding: utf8
23
-  reconnect: true
24
-  pool: 5
17
+  adapter: <%= ENV['DATABASE_ADAPTER'] || "mysql2" %>
18
+  database: <%= ENV['TEST_DATABASE_NAME'] || "huginn_test" %>
19
+  username: <%= ENV['DATABASE_USERNAME'] || "root" %>
20
+  password:  <%= ENV['DATABASE_PASSWORD'] || "" %>
21
+  socket: <%= ENV['DATABASE_SOCKET'] || ["/var/run/mysqld/mysqld.sock", "/opt/local/var/run/mysql5/mysqld.sock", "/tmp/mysql.sock"].find{ |path| File.exist? path } %>
22
+  encoding: <%= ENV['DATABASE_ENCODING'] || "utf8" %>
23
+  reconnect: <%= ENV['DATABASE_RECONNECT'] || "true" %>
24
+  pool: <%= ENV['DATABASE_POOL'] || "5" %>
25 25
 
26 26
 production:
27 27
   adapter: <%= ENV['DATABASE_ADAPTER'] || "mysql2" %>